// 问卷发布相关接口
import {getRequest, postRequest} from '../baseRequest'

// 查询项目权限组详细
export const listAuthGroup = (key) => getRequest('/form/auth/group/list', {formKey: key})

// 查询授权组授权对象
export const getAuthObjs = (id) => getRequest('/form/auth/' + id)

// 查询授权组授权对象
export const saveAuthObjs = (data) => postRequest('/form/auth/save', data)

// 查询项目权限组详细
export const getAuthGroup = (id) => getRequest('/form/auth/group/' + id)

// 新增项目权限组
export const createAuthGroup = (data) => postRequest('/form/auth/group/create', data)

// 修改项目权限组
export const updateAuthGroup = (data) => postRequest('/form/auth/group/update', data)

// 删除项目权限组
export const delAuthGroup = (id) => postRequest('/form/auth/group/delete/' + id)

// 获取问卷用户的权限
export const getFormUserAuthRequest = (formKey) => getRequest('/user/form/auth/' + formKey)

// 获取问卷公开发布状态
export const getFormStatusRequest = (formKey) => getRequest('/user/form/' + formKey)
// 发布问卷
export const publishFormRequest = (data) => postRequest('/user/form/publish', data)
// 停止发布问卷
export const stopPublishFormRequest = (data) => postRequest('/user/form/stop', data)
// 查询扩展字段列表
export const getFormLinkExtListRequest = (formKey,extType) => getRequest('/user/form/link/extList' ,{formKey:formKey,extType:extType})
// 查询扩展字段列表
export const saveFormLinkExtRequest = (data) => postRequest('/user/form/link/ext', data)
// 删除扩展字段列表
export const deleteFormLinkExtRequest = (data) => postRequest('/user/form/link/ext/delete', data)
// 保存公开查询条件
export const savePublicQueryRequest = (data) => postRequest('/user/form/public/query/save', data)
// 删除公开查询条件
export const deletePublicQueryRequest = (data) => postRequest('/user/form/public/query/delete', data)
// 保存公开查询条件
export const getPublicQueryListRequest = (formKey) => getRequest(`/user/form/public/query/${formKey}/list`)
// 公开查询条件页内容
export const getPublicQueryContentRequest = (formKey, queryId) => getRequest(`/user/form/public/query/${formKey}/content`, {queryId})
// 查询公开查询数据
export const listPublicQueryDataRequest = (data) => postRequest('/user/form/public/query/data', data)
// 批量生成扩展链
export const batchExt = (formKey) => getRequest('/cloud/publish/user/form/link/batchExt',{formKey: formKey})
// 是否展示【批量生成扩展链】按钮
export const qryLibraryBindInfo = (formKey) => getRequest(`/user/form/link/qryLibraryBindInfo/${formKey}`)

export const getMsgList = (queryParams) => getRequest(`/cloud/publish/user/form/getMsgList`,queryParams)
export const getSendMsgInfoList = (queryParams) => getRequest(`/cloud/publish/user/form/getSendMsgInfoList`,queryParams)
export const oneKeySendMsg = (formKey) => getRequest(`/cloud/publish/user/form/oneKeySendMsg`,formKey)
export const reSendMsg = (msgId) => getRequest(`/cloud/publish/user/form/reSendMsg`,{msgId:msgId})
export const batchSendFormUrlMsg = (data) => postRequest(`/cloud/publish/user/form/batchSendFormUrlMsg?formKey=${data.formKey}`,data.sampleIds)

export const addPublicReleaseSetting = (publicRelease,formKey) => getRequest(`/cloud/publish/user/form/addPublicReleaseSetting`,{formKey:formKey,publicRelease:publicRelease})

